package com.easy.carl.algorithm.tree;

import com.easy.leetcode.tree.TreeNode;

public class SumOfLeftLeaves404 {
    public int sumOfLeftLeaves(TreeNode root) {
        if (root==null){
            return 0;
        }
        int l=0;
        if (root.left!=null&&root.left.left==null&&root.left.right==null){
            l=root.left.val;
        }
        return l+sumOfLeftLeaves(root.left)+sumOfLeftLeaves(root.right);
    }
}
